#ifndef _PROMPTS_H_
#define _PROMPTS_H_

#include "includes.h"

struct Response {
	bool finished;
	std::string message;

	Response(bool f, char* m) { finished = f; message = m; }
};
	

class MessageBox : public TCODConsole {
public: 
	int x;
	int y;
	int width;
	int height;
	std::string title;
	std::string content;
	TCODConsole* contentConsole;

	MessageBox(int x, int y, int w, int h, std::string t, std::string c) : TCODConsole(w, h) 
	{
		x = x;
		y = y;
		width = w;
		height = h;

		this->setForegroundColor(TCODColor::black);

		this->setBackgroundColor(TCODColor::lightGrey);
		this->rect(0, 0, w, h, true);
		this->setBackgroundColor(TCODColor::white);
		this->rect(1, 1, w-2, h-2, true);

		int titlepos = floor((w-t.size())/2.0); // - 6 for the surrounding brackets in printf
		this->printLeft(titlepos, 0, TCOD_BKGND_NONE, t.c_str());
		this->printLeftRect(2, 2, w-4, h-4, TCOD_BKGND_NONE, c.c_str());
		//this->rect(0, 0, 8, 2, false);
	}

	virtual Response* update(TCOD_key_t);
	void setcontent(std::string);
	std::string getcontent(void);
	void blit(TCODConsole*) const; 
};

#endif
